// Variables
@import 'variables';

// Bootstrap
@import '~bootstrap/scss/bootstrap';

// Pages
@import 'Dialogs/LanguageSelectionDialog';
@import 'Login/Login';
@import 'Home/Home';
@import 'UserManual';
@import 'UserSettings/UserSettings';
@import 'Review/Review';
@import 'Text/TextBlockGroup';
@import 'Text/VocabularyBox';
@import 'Text/VocabularyHoverBox';
@import 'Text/VocabularySideBox';
@import 'Text/VocabularyBottomSheet';
@import 'Text/VocabularySearchBox';
@import 'TextReader/TextReader';
@import 'TextReader/TextReaderChapterList';
@import 'TextReader/TextReaderGlossary';
@import 'Vocabulary/Vocabulary';
@import 'Vocabulary/VocabularyEditDialog';
@import 'Vocabulary/VocabularyExport';
@import 'Kanji/KanjiList';
@import 'Kanji/KanjiDetails';
@import 'Library/Books';
@import 'Library/BookChapters';
@import 'Library/ImportDialog';
@import 'Library/EditBookDialog';
@import 'Library/JellyfinSubtitleList';
@import 'slider';
@import 'DarkMode';


// admin pages
@import 'Admin/AdminSettings';
@import 'Admin/AdminLanguageSettings';
@import 'Admin/AdminDictionarySettings';
@import 'Admin/AdminApiSettings';
@import 'Admin/AdminReviewSettings';

@font-face {
    font-family: Varela;
    src: url('/fonts/VarelaRound-Regular.ttf');
}

* {
    font-family: sans-serif;
}

// alert
.v-alert.primary,
.v-alert.success,
.v-alert.error {
    a, a:visited, a:active {
        color: white;
    }
}

#logo span  {
    font-family: Varela !important;
    font-size: 26px;
    user-select: none;
    cursor: normal;
}

// container size
.container {
    padding-left: 8px;
    padding-right: 8px;
}

@media (min-width: 576px) {
    .container-sm, .container {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100%;
    }
}

@media (min-width: 992px) {
    .container-sm, .container {
        max-width: 960px;
    }
}

// toggle button
.v-item-group .v-btn.v-btn--active {
    background-color: var(--v-primary-base) !important;
    border-color: var(--v-primary-base) !important;
    color: var(--v-foreground-base) !important;
    
    i {
        color: var(--v-foreground-base) !important;
    }

    &:before {
        opacity: 0;
    }
}

// tabs
.v-slide-group__prev {
    display: none !important;
}

// tab item
.v-window.v-item-group:not(.no-background), 
.v-window:not(.no-background) .v-window-item, 
.v-window:not(.no-background).v-window__container {
    background-color: var(--v-foreground-base);
}

// v-card
.v-card.theme--light,
.v-card.theme--light > .v-card__subtitle, 
.v-card.theme--light > .v-card__title, 
.v-card.theme--light > .v-card__actions,
.v-card.theme--light > .v-card__text {
    color: var(--v-text-base);
    background: var(--v-foreground-base);
}

// pagination
.theme--light.v-pagination .v-pagination__item,
.theme--light.v-pagination .v-pagination__navigation {
    background: var(--v-foreground-base);
}

// v-menu
.v-menu__content .theme--light.v-list-item:not(.v-list-item--active):not(.v-list-item--disabled) {
    background-color: var(--v-foreground-base);
    color: var(--v-text-base);
}

.v-menu__content .theme--light.v-list-item.v-list-item--active {
    background-color: var(--v-primary-base) !important;
    color: white !important;
}

.v-menu__content .v-list-item.v-list-item--active i {
    color: white !important;
}

// vocabulary edit stage buttons
#vocabulary-edit-stage-buttons,
#vocabulary-bottom-sheet-stage-buttons {
    button.v-btn.theme--light {
        background-color: var(--v-foreground-base);
        border-color: var(--v-foreground-base);

        &.v-btn--active{
            background-color: var(--v-primary-base);
        }

        &.v-btn--active .v-btn__content {
            color: white;
        }
    }
}

// v-list
.theme--light.v-list {
    background: var(--v-foreground-base);
}

// tab bar
.v-slide-group__wrapper {
    background-color: var(--v-foreground-base);
}

// v-stepper
.theme--light.v-stepper {
    background: var(--v-foreground-base);
}

// v-menu
.v-menu__content.theme--light {
    border: 1px solid var(--v-customBorder-base) !important;
}

button.v-btn.menu-button {
    background: var(--v-foreground-base) !important;
    color: var(--v-text-base) !important;
    
    span {
        color: var(--v-text-base) !important;
    }
}

// table
.theme--light.v-data-table.v-data-table--fixed-header thead th,
.theme--light.v-data-table {
    background: var(--v-foreground-base);
    color: var(--v-text-base);
}

.v-data-table>.v-data-table__wrapper>table>thead>tr>th {
    font-size: 14px;
}

// custom expansion card
.expansion-card {
    .v-card__title {
        font-size: 18px !important;
    }

    &:not(:last-child) .expansion-card-title,
    &.open .expansion-card-title {
        border-bottom: 1px solid var(--v-customBorder-base);
    }

    .expansion-card-title {
        user-select: none;

        &:hover {
            cursor: pointer;
            transition: .2s;
            background-color: var(--v-gray2-base);
        }
    }

    .expansion-card-content {
        box-sizing: border-box;
        overflow: hidden;
        height: 0px;
        transition: height .8s;
        padding-bottom: 0px;
        transform: scaleY(0);
    }
    
    &:not(:last-child) .expansion-card-content {
        border-bottom: 1px solid var(--v-customBorder-base);
    }
    
    &.open .expansion-card-content{
        height: auto;
        padding-bottom: 16px;
        padding: 16px;
        transform: scaleY(1);
    }
}

// progress bar
.v-progress-linear.delete-dialog-delay .v-progress-linear__determinate {
    transition: 0s !important;
}

// radio button
.v-radio label {
    margin: 0px !important;
}

// slider
.v-slider__track-container {
    height: 4px !important;
    border-radius: 4px !important;
}

.v-slider__thumb-label {
    opacity: 0 !important;
    height: 28px !important;
    width: auto !important;
    transform: translateY(-20%) translateY(-12px) translateX(-50%) !important;
    border-radius: 6px !important;
    padding: 0px 6px !important;
    font-size: 14px !important;
    text-align: center;
    transition: .2s !important;
    
    div {
        transform: none !important;
    }
}

.v-slider:hover .v-slider__thumb-label {
    opacity: 1 !important;
}

// it's required because otherwise it had 
// weird white background outside of rounded corners
.v-dialog.date-picker-dialog {
    border-radius: 8px !important;
    overflow: hidden !important;

    .v-picker.v-card.v-picker--date {
        border-radius: 0px !important;
        overflow: hidden !important;
        background: linear-gradient(180deg, var(--v-primary-base) 0%, #ffffff 50%) !important;
    }
}

.v-date-picker-table--month td .v-btn {
    border-radius: 18px !important;
}

.v-overlay {
}

.v-sheet.v-app-bar.v-toolbar:not(.v-sheet--outlined) {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2), 0 1px 2px rgba(0, 0, 0, .35);
}

.v-input--selection-controls .v-input__slot>.v-label {
    height: 28px;
    line-height: 28px;
    margin-bottom: 0px;
}

.v-ripple__container {
    display:none !important;
}

/* Default font color */
.subheader,
.theme--light.v-card,
.theme--light.v-card>.v-card__text, 
.theme--light.v-data-table,
.theme--light.v-data-table>.v-data-table__wrapper>table>thead>tr>th {
    color: #2d2d2d;
}

.v-pagination li button {
    box-shadow: none;
    border: 1px solid var(--v-customBorder-base);
    border-radius: 6px;
    font-size: 15px;

    &:not(.v-pagination__item--active):hover {
        background-color: #0000000a !important;
    }

    &:not(.v-pagination__item--active):active {
        background-color: var(--v-gray3-base) !important;
    }
}

.v-tab {
    color: rgba(255, 255, 255, 1);
}

.v-menu__content {
    border-radius: 4px !important;
    
    .v-list-item {
        // background-color: var(--v-warning-base) !important;
        // color: white !important;
        // border-radius: 24px !important;
        // margin-top: 4px;
        // margin-bottom: 4px;

        &.v-list-item--active {
            background-color: var(--v-gray3-base) !important;
            color: var(--v-text-base) !important;
        }
    }

    &.rounded {
        border-radius: 8px !important;
    }
}

.v-btn.menu-button,
a.v-btn.menu-button {
    width: 100%;
    line-height: 36px !important;
    display: flex;
    border-radius: 0px;
    margin: 0px;
    border: 0px;
    box-shadow: none;
}

.regular-list-height {
    height: 48px;
}

#navigation-drawer {
    height: 100% !important;

    #logo span{
        font-size: 24px !important;
    }

    div.navigation-button,
    a.navigation-button {
        text-decoration: none !important; 
        padding-left: 16px;
        
        &.v-list-item--active {
            background-color: var(--v-primary-base) !important;
            color: white !important;
        }
    }

    &.v-navigation-drawer--mini-variant {

        width: 64px;

        div.navigation-button,
        a.navigation-button {
            padding-left: 12px !important;
            padding-right: 0px !important;
        }

        .mini-drawer-button {
            box-sizing: border-box;
            width: 46px !important;
            height: 46px !important;
            min-width: 46px !important;
            max-width: 46px !important;
            padding-left: 0px !important;
            padding-right: 0px !important;
            margin: 0px 4px;
        }
    }
}

.subheader {
    display: block;
    width: 100%;
    height: 42px;
    line-height: 42px;
    font-size: 24px;
    margin-bottom: 4px;

    &.subheader-margin-top {
        margin-top: 40px;
    }

    &.small-margin {
        margin-top: 20px;
    }
}

html, body, div#app {
    background: var(--v-background-base);
    scroll-behavior: smooth;
    scroll-padding-bottom: 32px;
    height: 100%;
    overflow: visible;
}

main {
    display: block;
    width: 100%;
    height: 100%;
}

body {
    overflow: auto;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: var(--v-background-base);
    z-index: 100;
}

.v-card ::-webkit-scrollbar{
    background: var(--v-foreground-base);
}

.v-input.v-textarea ::-webkit-scrollbar {
    background: rgba(0, 0, 0, 0) !important;
}

::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--v-primary-base), transparent 10%);

    border-radius: 4px;
    z-index: 100;
}

div.v-bottom-navigation{
    position: fixed !important;
    bottom: 0px !important;
    z-index: 4;
}

div.v-btn,
button.v-btn,
a.v-btn {
    &:not(.toolbar-button):not(.stage-button) {
        text-decoration: none !important;
        text-transform: unset !important;
    }

    padding-left: 18px !important;
    padding-right: 18px !important;
}

.v-bottom-navigation .v-btn,
div.v-btn.primary, div.v-btn.success, div.v-btn.error, div.v-btn.info, div.v-btn.purple,
button.v-btn.primary, button.v-btn.success, button.v-btn.error, button.v-btn.info, button.v-btn.purple,
a.v-btn.primary, a.v-btn.success, a.v-btn.error , a.v-btn.info, a.v-btn.purple {
&:not(.toolbar-button):not(.stage-button):not(.v-btn--router){
        color: #ffffff;

        span {
            color: #ffffff;
        }

        i {
            margin-top: 2px;
        }
    }
}

div.v-data-table {
    &.no-background {
        background-color: rgba(0, 0, 0, 0);
    }

    &.no-row-border {
        td, th, tr {
            border-top: 0px !important;
            border-bottom: 0px !important;
        }
    }

    &.no-hover .v-data-table__wrapper table {
        tbody tr:hover,
        tbody tr:hover td {
            background-color: transparent !important;
        }
    }

    &.no-lines .v-data-table__wrapper table {
        tbody tr,
        tbody tr td {
            border-bottom: none !important;
        }
    }
}


@media (max-width: 959px) {
    html, body, div#app {
        scroll-behavior: smooth;
        scroll-padding-bottom: 90px;
    }

    main.v-main {
        padding-left: 0px !important;
    }

    .v-main__wrap > .container {
        padding-bottom: 100px !important;
    }
}

@media (max-width: 767px) {
    .v-slider__thumb-label {
        // opacity: 1 !important;
    }
}

@media (max-width: 600px) {
    .v-bottom-navigation .v-btn,
    div.v-btn.primary, div.v-btn.success, div.v-btn.error, div.v-btn.info, div.v-btn.purple,
    button.v-btn.primary, button.v-btn.success, button.v-btn.error, button.v-btn.info, button.v-btn.purple,
    a.v-btn.primary, a.v-btn.success, a.v-btn.error , a.v-btn.info, a.v-btn.purple {
        &:not(.toolbar-button):not(.stage-button) {
            i {
                margin-top: 0px;
            }
        }
    }
}

@media (max-width: 380px) {
    div.v-bottom-navigation a {
        min-width: 0px !important;
    }
}

// style for e-ink theme
#app main.eink * {
    transition: 0s !important;
}

#app.eink {
    .v-dialog, .v-overlay {
        transition: 0s !important;
    }
}

#navigation-drawer.eink {
    transition-duration: 0s !important;
}